package com.cy.web;

import com.alibaba.fastjson.JSONArray;
import com.cy.bean.Student;
import com.cy.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class myController {

    @Autowired
    private MyService myService;

    //    <!-- 根据 学员 id 查找 学员成绩 ----> 模拟考试信息 -->
    @RequestMapping("/testConditions")
    @ResponseBody
    public  String selectScoreById(Student student){
        System.out.println("----------testConditions-----");

        List<Student> studentList = myService.selectScoreById(student.getSid(),student.getSacc());
        String s =  JSONArray.toJSONString(studentList);
        return s ;
    }

}
